<?php

namespace app\api\controller;

use app\BaseController;
use frame\lib\Db;

class Base extends BaseController
{
    protected $uid;
    protected $user_id;
    public function __construct()
    {
        parent::__construct();
        $confPath = ROOT_PATH . 'config/system.php';
        $data = include $confPath;
        if ($data['switch']['site'] == 0) {
            error('当前接口已全面关闭，具体开启等管理员通知');
        }
        if (!@$_SESSION['api']['username']) error('请登录后再来操作', 210);
        // 二级用户ID
        $this->uid = $_SESSION['api']['id'];
        // 一级用户ID
        $this->user_id = $_SESSION['api']['user_id'];
        $this->verifyVip($this->user_id);
        $this->verifyStatus($this->uid);
    }
}
